package utils

import (
	"github.com/golang-jwt/jwt/v5"
)

type JWT struct{}

type Claims struct {
	UserId int `json:"user_id"`
	jwt.RegisteredClaims
}

func (j *JWT) CreateToken(user_id int) *string {
	jwtKey := []byte("sdf23fdwf2")
	claims := Claims{
		user_id,
		jwt.RegisteredClaims{},
	}
	data := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
	token, _ := data.SignedString([]byte(jwtKey))
	return &token
}
